package com.capa.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update
import com.capa.model.ChatMessage

@Dao
interface ChatMessageDao {

    @Insert
    fun insert(message: ChatMessage)

    @Insert
    fun insertAll(vararg messages: ChatMessage)

    @Update
    fun update(message: ChatMessage)

    @Update
    fun updateAll(vararg message: ChatMessage)

    @Delete
    fun delete(message: ChatMessage)

    @Query("DELETE FROM tbl_chat_message")
    fun deleteAll()

    @Query("SELECT * FROM tbl_chat_message ORDER BY id ASC ")
    fun getAll(): List<ChatMessage>
}